package pl.diagnoser.client.tools;

import java.io.Serializable;
import java.util.List;

import pl.diagnoser.client.dto.AttributeDictDTO;
import pl.diagnoser.client.dto.UserDTO;

public class LogIn implements Serializable {

	private static final long serialVersionUID = 1L;
	private static LogIn instance;
	private UserDTO user;
	private String hibernateCfgPath;
	private List<AttributeDictDTO> objectFormFields;
	
	public static int SEARCH_APP = 1;
	
	public static LogIn getInstance() {
		if(instance == null)
			instance =  new LogIn();
		return instance;
	}
	
	public UserDTO getUser() {
		return this.user;
	}
	
	public void setUser(UserDTO user) {
		this.user = user;
	}
	
	public List<AttributeDictDTO> getObjectFormFields() {
		return this.objectFormFields;
	}
	
	public void setObjectFormFields(List<AttributeDictDTO> objectFormFields) {
		this.objectFormFields = objectFormFields;
	}
	
	public boolean isObjectFieldsLoaded() {
		if(objectFormFields != null && objectFormFields.size() > 0)
			return true;
		else
			return false;
	}
	
	public String getHibernateCfgPath() {
		return hibernateCfgPath;
	}
	
	public void setHibernateCfgPath(String path) {
		this.hibernateCfgPath = path;
	}
}
